Get Audit subscription status
This endpoint allows the end user to fetch the current status of the audit subscription. If the subscription is running, it should return 'active' status. Otherwise, it will return 'pause'
URL : http://34.122.70.8/api/v1/audit/subscription/status
Method : GET
Auth required : YES
| Headers | Type | Description |
|---|---|---|
| api-key | string | Unique api key provided to each Customer |
Permissions required : None
Data constraints
Provide info including where the service should forward the Audit Records, the maximum number of records in each payload, and the frequency for sending them.
Response Body:
| Field | Type | Description |
|---|---|---|
| status | Boolean | Status of the request |
| msg | string | Response message from server |
| data | Data Object | |
| error_code | string | Error code received from server in case of error in fetching status of subscription |
| error_msg | string | Error message received from server in case of error in fetching status of subscription |
Data Object:
| Field | Type | Description |
|---|---|---|
| status | object | Account level default_preferences object |
Data example
Success Response
Condition : Subscription in pause status.
Code : 200 OK
Content example
{
"status": true,
"msg": "Audit subscription status fetched successfully",
"data": {
"status": "pause"
}
}
Or
Condition : Subscription in pause status.
Code : 200 OK
Content example
{
"status": true,
"msg": "Audit subscription status fetched successfully",
"data": {
"status": "active"
}
}
Error Responses
Condition : If subscription does not exist.
Code : 404 Not Found
Content :
{
"status": false,
"error_code": "NOT_FOUND",
"error_msg": "Subscription record not found"
}
Or
Condition : If api-key is not passed in request header or is wrong.
Code : 401 Unauthorized
Content example
{
"status": false,
"error_code": "AUDIT_UNAUTHORIZED",
"error_msg": "Missing/MisMatch API KEY"
}
- Nodejs
- React
const fetch = require('node-fetch');
let url = 'http://34.122.70.8/api/v1/audit/subscription/status';
let options = {method: 'GET', headers: {'api-key': '<API_KEY>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
let headersList = {
"api-key": "<API_KEY>"
}
let response = await fetch("http://34.122.70.8/api/v1/audit/subscription/status", {
method: "GET",
headers: headersList
});
let data = await response.text();
console.log(data);